<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;

class UserController extends Controller
{
   public function index()
   {
        return view('user.index');
   }
   public function addSave(Request $request)
   {
      $input=$this->validate($request,[
           'username'=>'required|between:2,6',
           'password'=>'required|confirmed',
           'password_confirmation'=>'required',
           'email'=>'required',
           'username'=>'required',
       ],[
           //表单字段名.规则名=>你想输出的话
           'username.required'=>'用户名不写',
           'username.between'=>'2-6之间',
           'password.confirmed'=>'确认密码不能为空',

           'password.required'=>'密码必须填写',
       ]);
       dump($input);
   }
}
